unit MoneyReport;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, BaseReport, cxGraphics, cxLookAndFeels, cxLookAndFeelPainters,
  Menus, cxControls, cxContainer, cxEdit, dxSkinsCore,
  dxSkinsDefaultPainters, cxStyles, dxSkinscxPCPainter,
  cxDataStorage, DB, cxDBData, DBActns, StdActns,
  ActnList, ImgList, cxGridLevel, cxClasses, cxGridCustomView,
  cxGridCustomTableView, cxGridTableView, cxGridBandedTableView,
  cxGridDBBandedTableView, cxGrid, ComCtrls, cxCheckBox, cxDropDownEdit,
  cxCalendar, cxLabel, ExtCtrls, cxTextEdit, cxMaskEdit, cxLookupEdit,
  cxDBLookupEdit, cxDBLookupComboBox, StdCtrls, cxButtons, DBClient, MemDS,
  DBAccess, Uni, cxGridCustomPopupMenu, cxGridPopupMenu, dxSkinsForm,
  cxSplitter, cxTreeView, ToolWin, dxCore, cxDateUtils, cxNavigator,
  cxCustomData, cxFilter, cxData, System.Actions, System.ImageList,
  cxDataControllerConditionalFormattingRulesManagerDialog, dxBarBuiltInMenu;

type
  TfrmMoneyReport = class(TfrmBaseReport)
    edtMoney: TcxDBLookupComboBox;
    dsReport: TDataSource;
    cdsReport: TClientDataSet;
    cdsReportmoneyid: TIntegerField;
    procedure FormCreate(Sender: TObject);
    procedure actRefreshExecute(Sender: TObject);
    procedure cdsReportmoneyidChange(Sender: TField);
  private
    { Private declarations }
  protected
    function GetParamValue(ParamName: string): Variant; override;
  public
    { Public declarations }
  end;

var
  frmMoneyReport: TfrmMoneyReport;

implementation

{$R *.dfm}

procedure TfrmMoneyReport.FormCreate(Sender: TObject);
begin
  inherited;
  cdsReport.CreateDataSet;
end;

function TfrmMoneyReport.GetParamValue(ParamName: string): Variant;
begin
  if ParamName = 'moneyid' then
  begin
    Result := -99;
    if edtMoney.Visible and edtMoney.Enabled and (not cdsReportmoneyid.IsNull) then
      Result := cdsReportmoneyid.AsInteger;
  end
  else
    Result := inherited GetParamValue(ParamName);
end;

procedure TfrmMoneyReport.actRefreshExecute(Sender: TObject);
begin
  inherited;
  OpenDynReportSet;
end;

procedure TfrmMoneyReport.cdsReportmoneyidChange(Sender: TField);
begin
  inherited;
  actRefresh.Execute;
end;

end.

